// components/search-hot/search-hot.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isSearch:String,
    history: Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    hot: null,
  },
  /**
   * 组件的方法列表
   */
  methods: {
    searchHot(e) {
      let kw = e.currentTarget.dataset.item;
      this.triggerEvent("changeValue", kw);
      // this.setStorage(kw);
    },
    clearHistory(){
      this.triggerEvent("clearHistory");
    }
  },
  lifetimes: {
    attached() {
      wx.request({
        url: 'http://api.kele8.cn/agent/https://app.vmovier.com/apiv3/search',
        success: (res) => {
          // console.log(res.data.data);
          this.setData({
            hot: res.data.data
          })
        }
      })
    }
  }
})